<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Stimulus360.Controllers.Ideas.IdeaFeedbackListingViewModel>" %>

<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="Stimulus360.Services" %>
<%@ Import Namespace="Stimulus360.Models.Data" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="centerContainer">
        <!-- Left Col Start -->
        <%Html.RenderPartial("IdeaDetailLeftNavigation", Model.IdeaSummary.IdeaId ); %>
        <!-- Left Col Ends -->
        <!-- Main Area Start -->
        <div class="mainInner colViewHdr">
            <div class="ideaListItem p10">
                <h1 class="floatLeft">
                    <%=Model.IdeaSummary.IdeaTitle %></h1>
                <div class="floatRight">
                    <a href="/Ideas/<%=Model.IdeaSummary.IdeaId%>/Feedback/Submit" class="headerLabelBtn"><span>
                        Submit Feedback</span></a>
                </div>
                <br clear="all" />
                <div class="ideaStatusBar">
                    <div class="floatLeft">
                        <%=Model.IdeaSummary.SubmittedDate.ToString("D", CultureInfo.CreateSpecificCulture("en-US"))%>
                        | by <%=Model.IdeaSummary.Submitter %></div>
                </div>
            </div>
            <h3>
                Community feedback</h3>
            <div id="feedbackListContainer">
                <%Html.RenderPartial("FeedbackList", Model.Feedback); %>
            </div>
            <br clear="all" />
            <div class="pagerbg">
                <div id="pagerIdeaList" class="pager">
                </div>
            </div>
            <!-- Main Area End -->
        </div>
    </div>

    <script type="text/javascript" language="javascript">
        $(document).ready(function() {
            $("#feedbackListTag").addClass("selected");
            var totalPages_Idea = "<%=Model.Feedback.TotalPages %>";
            if (totalPages_Idea == 1) {
                $(".pagerbg").hide();
            }
            var totalCount = "<%=Model.Feedback.TotalCount %>";
            if (totalCount == 0) {
                $(".pagerbg").hide();
            }
            
            var currentPage = "<%=Model.Feedback.PageIndex%>";

            $("#pagerIdeaList").pager({ pagenumber: currentPage, pagecount: totalPages_Idea, buttonClickCallback: PageClick_IdeaList });
        });

        PageClick_IdeaList = function(pageclickednuber) {
            var ideaId = "<%=Model.IdeaSummary.IdeaId%>";
            var pageIndex = pageclickednuber;
            window.location = "/Ideas/" + ideaId.toString() + "/Feedback/Page/" + pageIndex.toString();

        } 
    </script>

</asp:Content>
